package qldc.pm.ksdl.util;


public enum EnumGioiTinh {
	NAM("nam", 1), NU("nu", 0);

	private String key;
	private int value;

	EnumGioiTinh(String key, int value) {

		this.setKey(key);
		this.setValue(value);
	}

	public String getKey() {

		return key;
	}

	public void setKey(String key) {

		this.key = key;
	}

	public long getValue() {

		return value;
	}

	public void setValue(int value) {

		this.value = value;
	}

	public static String getKey(int value) {

		if (value == NU.value) {
			return NU.key;
		}
		return NAM.key;
	}

	public static int getValue(String key) {

		if (key.equalsIgnoreCase(NU.key)) {
			return NU.value;
		}
		return NAM.value;
	}
}